import Vue from 'vue'
import Vuex from 'vuex'
import location from './location'


Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    list: [],
    rank_list: [],
    wow_swiper: [],
    swiperfour: [],
    sales: [],
    arr1: [],
    shop: [],
    ishow: true
  },
  mutations: {
    setList(state,data) {
      state.list = data
    },
    setranking(state,data) {
      state.rank_list = data
    },
    setswiper(state,data) {
      state.wow_swiper = data
    },
    setswiperfour(state,data) {
      state.swiperfour = data
    },
    setsales(state,data) {
      state.sales = data
    },
    shop(state,data) {
      state.shop = data
    },
    setshow(state,data) {     
      state.ishow = data
    }
  },
  actions: {
    getList({commit},data) {
      commit("setList",data)
    },
    ranking({commit},data) {
      commit("setranking",data)
    },
    swiper({commit},data) {
      commit("setswiper",data)
    },
    swiperfour({commit},data) {
      commit("setswiperfour",data)
    },
    getsales({commit},data) {
      commit("setsales",data)
    },
    remove({commit}) {
      commit("remove")
    },
    shop({commit},data) {
      commit("shop",data)
    },
    setshow({commit},data) {
      commit("setshow",data)
    }
  },
  modules: {
    location
  }
})
